package demoMod.stsconsole.monsters.exordium;

import demoMod.stsconsole.dungeons.AbstractDungeon;
import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.monsters.AbstractMonster;
import demoMod.stsconsole.powers.CurlUpPower;
import demoMod.stsconsole.powers.StrengthPower;

public class LouseNormal extends AbstractMonster {
    public static final String ID = "LouseNormal";

    public LouseNormal() {
        super(ID);
        setHp(10, 15);
        this.damage.add(new DamageInfo(5 + AbstractDungeon.monsterRng.nextInt(3), this));
    }

    @Override
    public void usePreBattleAction() {
        this.applyPower(this, new CurlUpPower(this, 4 + AbstractDungeon.monsterRng.nextInt(5)));
    }

    @Override
    protected void getMove(int aiRng) {
        if (aiRng < 25) {
            if (this.lastTwoMoves(4)) {
                this.setMove(3, Intent.ATTACK, this.damage.get(0));
            } else {
                this.setMove(4, Intent.BUFF, monsterStrings.get(1));
            }
        } else if (this.lastTwoMoves(3)) {
            this.setMove(4, Intent.BUFF, monsterStrings.get(1));
        } else {
            this.setMove(3, Intent.ATTACK, this.damage.get(0));
        }
    }

    @Override
    public void takeTurn() {
        switch (this.nextMove) {
            case 3:
                this.defaultTarget.damage(this.damage.get(0));
                break;
            case 4:
                this.applyPower(this, new StrengthPower(this, 3));
                break;
        }
        rollMove();
    }
}
